import { _decorator, CCInteger, Component, Enum, Node } from 'cc';
import { RewardType } from '../Enum';
const { ccclass, property } = _decorator;

@ccclass('Reward')
export class Reward extends Component {

    @property
    rewardType: RewardType = null;

    @property
    private speed: number = 90;

    start() {

    }

    update(dt: number) {
        //控制位移
        const p = this.node.position;
        this.node.setPosition(p.x, p.y - this.speed * dt, p.z);

        if (this.node.position.y < -500) {
            this.node.destroy();
        }
    }
}


